<template>
  <div>
    <el-container>
      <el-header
        style="
          border: 1px;
          text-align: left;
          font-size: 50px;
          height: 70px;
          background-color: gainsboro;
        "
        >智能管理系统</el-header
      >
      <el-container>
        <el-aside
          style="
            border: 1px;
            width: 150px;
            height: 550px;
            background-color: antiquewhite;
          "
        >
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>系统信息管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">
                    <router-link to="/dept">部门管理</router-link>
                    
                </el-menu-item>
                <el-menu-item index="1-2">
                    <router-link to="/emp">员工管理</router-link>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main style="border: 1px; height: 550px; background-color: bisque">
          <!-- //中间 -->
          <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="姓名">
              <el-input
                v-model="formInline.user"
                placeholder="请输入姓名"
              ></el-input>
            </el-form-item>
            <el-form-item label="性别">
              <el-select v-model="formInline.region" placeholder="请选择">
                <el-option label="男" value="boy"></el-option>
                <el-option label="女" value="girl"></el-option>
              </el-select>
            </el-form-item>
     
 
<!-- ----------------------------------------- -->
<template>
    <el-form-item label="入职时间">
        <el-date-picker
      v-model="value1"
      type="monthrange"
      range-separator="至"
      start-placeholder="开始月份"
      end-placeholder="结束月份">
    </el-date-picker>
  <el-form-item>
              <el-button type="primary" @click="onSubmit">查询</el-button>
            </el-form-item>
            </el-form-item>
</template>

<el-table :data="tableData" style="width: 100%">
    <el-table-column prop="name" label="姓名" width="180"></el-table-column>
    <el-table-column prop="gender" label="性别" width="180">

        <template slot-scope="scope">
    <!-- 使用 v-if 和 v-else 或者三元运算符来判断并显示 -->
    <span v-if="scope.row.gender === 1">男</span>
    <span v-else-if="scope.row.gender === 0">女</span>
    <!-- 如果有其他值，可以考虑添加兜底处理，比如： -->
    <span v-else>未知</span>
    <!-- 或者简化的三元表达式 -->
    <!-- <span>{{ scope.row.gender === 1 ? '男' : '女' }}</span> -->
  </template>
    </el-table-column>


    <el-table-column prop="job" label="职位" width="180"></el-table-column>
    <el-table-column prop="entrydate" label="入职日期" width="180"></el-table-column>
    <el-table-column label="操作">
        <el-button type="primary" size="mini">编辑</el-button>
        <el-button type="danger" size="mini">删除</el-button>
    </el-table-column>
</el-table>


<div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>

         </el-form>
        </el-main>
      








      </el-container>
    </el-container>
  </div>
</template>

<style>
</style>

<script>
import axios from 'axios';
export default {
  data() {
    return {
         startTime: '',
        endTime: '',
      formInline: {
        user: "",
        region: "",
      },
      ruleForm: {
        desc: "",
      },
      rules: {
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请选择活动区域", trigger: "change" },
        ],
      },
      tableData:[],
    };
  },

  methods: {
    onSubmit() {
      console.log("submit!");
    },
  },
  mounted() {
  axios.get("http://yapi.eehp.cn/mock/61/user/findAll").then((result) => {
       this.tableData = result.data.data;
   
    });
},
};
</script>